import ProCard from '@ant-design/pro-card';
import ProDescriptions from '@ant-design/pro-descriptions';
import React from 'react';
import styles from '../index.less';
import { connect } from 'umi';

const Details = (props) => {
  const { item } = props;
  item.blockchain = '安权链';

  const detailsCard = item && (
    <ProCard className={styles.itemCard} title="作品信息" headerBordered>
      <ProDescriptions
        bordered
        column={1}
        columns={[
          {
            title: '作品介绍',
            dataIndex: 'description',
          },
          {
            title: '确权编号',
            dataIndex: 'txHash',
          },
          {
            title: '文件编号',
            dataIndex: 'fileHash',
          },
          {
            title: '区块链',
            dataIndex: 'blockchain',
          },
        ]}
        dataSource={item}
      />
    </ProCard>
  );
  return detailsCard;
};

export default connect(({ item }) => ({
  item: item.item,
}))(Details);
